package com.itheima.day16.work;


import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
//公共得构造函数 反射进行创建对象
public class Demo {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        Class<?> aClass = Class.forName("com.itheima.day16.work.Student");
        Constructor<?> constructor = aClass.getConstructor(String.class, int.class, String.class);
        Object o = constructor.newInstance("小强", 46, "孤岛");
        System.out.println(o);

    }
}
